<?php
/*
fileHashDB
Copyright (c) 2010 The Hursk Group, LLC. All rights reserved.

www.hursk.com

hurskgroup@hursk.com

This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

*/

function c_initiate_xml($config_data) {
	$xml_string = '<?xml-stylesheet href="../common.css" type="text/css"?><fileHashDB version="'.$config_data[general][version].'" host="'.$config_data[general][hashdbhost].'"></fileHashDB>';
	$xml = new SimpleXMLElement($xml_string);
	return $xml;
}

function c_announce($xml) {
	if(isset($xml->error)) {
		header ('content-type: text/xml; charset="utf-8"');
		echo $xml->asXML();
		exit(1);
	} else {
		header ('content-type: text/xml; charset="utf-8"');
		echo $xml->asXML();
		exit(0);
	}
}
?>